<html>
<head><meta charset="utf-8"><title>Trait object with non-static lifetime is accepted where sta · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html">Trait object with non-static lifetime is accepted where sta</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="198376439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198376439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198376439">(May 21 2020 at 20:57)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span class="user-mention" data-user-id="116083">@pnkfelix</span> this issue with the patch in <a href="https://github.com/rust-lang/rust/issues/71896">#71896</a> applied do not compile and segfaults, instead it reports a proper error. So the patch would be fixing both <code>P-critical</code> issues.</p>



<a name="198379419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198379419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198379419">(May 21 2020 at 21:24)</a>:</h4>
<p>I'm not really sure if I'd <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> that much about this one <span aria-label="joy" class="emoji emoji-1f602" role="img" title="joy">:joy:</span></p>



<a name="198379522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198379522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198379522">(May 21 2020 at 21:26)</a>:</h4>
<p>if you're interested read more deeply the issue that my PR links and all the problems around the PR</p>



<a name="198443775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198443775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198443775">(May 22 2020 at 13:56)</a>:</h4>
<p>We haven't resolved what to do about that PR</p>



<a name="198443798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198443798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198443798">(May 22 2020 at 13:56)</a>:</h4>
<p>in terms of the regressions it injects, right?</p>



<a name="198451564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198451564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198451564">(May 22 2020 at 15:01)</a>:</h4>
<p>yep</p>



<a name="198479830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198479830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198479830">(May 22 2020 at 18:47)</a>:</h4>
<p>ugh let me look into the remaining issues there</p>



<a name="198481307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198481307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198481307">(May 22 2020 at 18:59)</a>:</h4>
<p>OK, so, so far only 1 would be "truly" unsound</p>



<a name="198481397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198481397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198481397">(May 22 2020 at 19:00)</a>:</h4>
<p>although I can't quite tell <em>what</em> the heck is going on with attr-1.0</p>



<a name="198481453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198481453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198481453">(May 22 2020 at 19:00)</a>:</h4>
<p>oh I bet it's something very similar to the first one</p>



<a name="198482904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198482904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198482904">(May 22 2020 at 19:14)</a>:</h4>
<p>OK so basically we have a few key traits where this is coming up</p>



<a name="198482916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198482916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198482916">(May 22 2020 at 19:14)</a>:</h4>
<p><code>dyn Future&lt;...&gt;</code>, <code>dyn Stream</code>, <code>dyn Iterator</code></p>



<a name="198482964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198482964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198482964">(May 22 2020 at 19:15)</a>:</h4>
<p>I have to say that the only fix I see for this would be <em>fairly</em> involved</p>



<a name="198482987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198482987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198482987">(May 22 2020 at 19:15)</a>:</h4>
<p>There might be a way to do a warning period</p>



<a name="198483010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198483010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198483010">(May 22 2020 at 19:15)</a>:</h4>
<p>Though that too would be fairly involved</p>



<a name="198483718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198483718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198483718">(May 22 2020 at 19:21)</a>:</h4>
<p>I hate making calls like this :)</p>



<a name="198484037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198484037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198484037">(May 22 2020 at 19:23)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/71896#issuecomment-632870040">comment summarizing the above</a></p>



<a name="198492934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198492934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198492934">(May 22 2020 at 20:45)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="198493004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Trait%20object%20with%20non-static%20lifetime%20is%20accepted%20where%20sta/near/198493004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Trait.20object.20with.20non-static.20lifetime.20is.20accepted.20where.20sta.html#198493004">(May 22 2020 at 20:46)</a>:</h4>
<p>going to place a reminder for this right after the release</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>